package com.fr.cell.core;

import com.fr.base.DefaultValues;
import com.fr.base.FRContext;
import com.fr.base.Inter;
import com.fr.report.parameter.Parameter;
import java.text.DateFormat;
import java.util.Date;
import java.util.List;

public class ParameterTableModel extends ListTableModel
{
  private String[] columnNames = { Inter.getLocText("Reportlet"), Inter.getLocText("Parameter") };

  public ParameterTableModel()
  {
    setColumn(this.columnNames);
  }

  public ParameterTableModel(String[] paramArrayOfString)
  {
    setColumn(paramArrayOfString);
  }

  public Object getValueAt(int paramInt1, int paramInt2)
  {
    Object localObject1 = getList().get(paramInt1);
    if (localObject1 instanceof Parameter)
    {
      Parameter localParameter = (Parameter)localObject1;
      if (paramInt2 == 0)
        return localParameter.getName();
      if (paramInt2 == 1)
      {
        Object localObject2 = localParameter.getValue();
        if (localObject2 != null)
        {
          if (localObject2 instanceof Date)
          {
            DefaultValues localDefaultValues = FRContext.getDefaultValues();
            return localDefaultValues.getDateFormat().format(localObject2);
          }
          return localObject2;
        }
        return "";
      }
    }
    return null;
  }

  public boolean isCellEditable(int paramInt1, int paramInt2)
  {
    return false;
  }
}